package com.jiao.testdemo.pattern.interpreter;

import java.util.Map;

/**
 * TODO(文件概要)
 *
 * <p> TODO(具体描述信息,可以不填)
 *
 * @author meetsocial
 * @version V1.0
 * @className: PlusExpression
 * @date 2024/11/15 11:11
 */
public class PlusExpression implements Expression{
    private Expression left;
    private Expression right;

    public PlusExpression(Expression left, Expression right) {
        this.left = left;
        this.right = right;
    }

    @Override
    public int interpret(Map<String, Integer> context) {
        return left.interpret(context) + right.interpret(context);
    }

}
